﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace TagChimp
{
    /// <summary>
    /// Holds Movie metadata info 
    /// </summary>
    /// <remarks></remarks>
    public class MovieInfo
    {


        /// <summary>
        /// Initializes a new instance of the <see cref="MovieInfo"/> class.
        /// </summary>
        public MovieInfo()
        {
            MediaType = "Movie";
            ReleaseYear = 2011;
            Genre = String.Empty;
            Rating = String.Empty;
            Directors = new List<string>();
            Producers = new List<string>();
            Cast = new List<string>();
            Description = String.Empty;
            CoverArt = String.Empty;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MovieInfo"/> class.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <param name="year">The year.</param>
        public MovieInfo(string title, int year):this()
        {
            
            this.Title = title;
            this.ReleaseYear = year;
        }
        /// <summary>
        /// Gets or sets the name of the series or movie.
        /// </summary>
        /// <value>The name of the series.</value>
        /// <remarks></remarks>
        public string Title { get; set; }
        /// <summary>
        /// Gets or sets the type of the media.
        /// </summary>
        /// <value>The type of the media.</value>
        /// <remarks></remarks>
        public string MediaType { get; set; }
        /// <summary>
        /// Gets or sets the release date.
        /// </summary>
        /// <value>The release date.</value>
        /// <remarks></remarks>
        public int ReleaseYear { get; set; }
        /// <summary>
        /// Gets or sets the genre.
        /// </summary>
        /// <value>The genre.</value>
        /// <remarks></remarks>
        public string Genre { get; set; }
        /// <summary>
        /// Gets or sets the rating.
        /// </summary>
        /// <value>The rating.</value>
        /// <remarks></remarks>
        public string Rating { get; set; }
        /// <summary>
        /// Gets or sets the directors.
        /// </summary>
        /// <value>The directors.</value>
        /// <remarks></remarks>
        public List<string> Directors { get; set; }
        /// <summary>
        /// Gets or sets the producers.
        /// </summary>
        /// <value>The producers.</value>
        /// <remarks></remarks>
        public List<string> Producers { get; set; }
        /// <summary>
        /// Gets or sets the cast.
        /// </summary>
        /// <value>The cast.</value>
        /// <remarks></remarks>
        public List<string> Cast { get; set; }
        /// <summary>
        /// Gets or sets the episode description.
        /// </summary>
        /// <value>The episode description.</value>
        /// <remarks></remarks>
        public string Description { get; set; }
        /// <summary>
        /// Gets or sets the cover art url.
        /// </summary>
        /// <value>The cover art url.</value>
        /// <remarks></remarks>
        public string CoverArt { get; set; }
        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>A <see cref="System.String"/> that represents this instance.</returns>
        /// <remarks></remarks>
        public override string ToString()
        {
            var type = GetType();
            PropertyInfo[] properties = type.GetProperties();
            var output = new StringBuilder();
            Array.ForEach(properties, property => output.Append(String.Format("{0}: {1} \n", property.Name, property.GetValue(this, null))));

            return output.ToString();
        }
    }
}
